﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using CARMSData.HelperClasses;

namespace CARMSBusiness
{
  public  class DatabaseSp
    {

      public static DataTable ExcuteSp(System.String strSqlInput, System.String groupdId, System.String sumName)
        {
            // create parameters
            SqlParameter[] parameters = new SqlParameter[1];
            parameters[0] = new SqlParameter("@strSqlInput", SqlDbType.VarChar, 7800, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Current, strSqlInput);
            parameters[1] = new SqlParameter("@GroupdID", SqlDbType.VarChar, 200, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Current, groupdId);
            parameters[2] = new SqlParameter("@SumName", SqlDbType.VarChar, 200, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Current, sumName);

            // Call the stored proc.
            DataTable toReturn = new DataTable("ExcuteSp");
            bool hasSucceeded = DbUtils.CallRetrievalStoredProcedure("[dbo].[ExcuteSp]", parameters, toReturn, null);

            return toReturn;
        }

    }
}
